package cn.codeartist.wechat.qywx.service.contact.impl;

import cn.codeartist.springboot.component.http.proxy.HttpProxy;
import cn.codeartist.wechat.qywx.entity.constants.QywxApiUrl;
import cn.codeartist.wechat.qywx.entity.dto.contact.QywxUserInfoDTO;
import cn.codeartist.wechat.qywx.service.auth.QywxAuthService;
import cn.codeartist.wechat.qywx.service.contact.QywxContactService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * jnai
 *
 * @author 艾江南
 * @date 2020/7/29
 */
@Service
public class QywxContactServiceImpl implements QywxContactService {

    private final static Logger logger = LoggerFactory.getLogger(QywxContactServiceImpl.class);

    @Autowired
    private QywxAuthService qywxAuthService;
    @Autowired
    private HttpProxy qywxHttpProxy;

    @Override
    public QywxUserInfoDTO getUserInfo(String userId) {
        return qywxHttpProxy.get(QywxApiUrl.USER_GET, QywxUserInfoDTO.class, qywxAuthService.getContactAccessToken(), userId);
    }
}
